#include "ServerRegion.hpp"

ServerRegion::ServerRegion():Region(){
    index = 0;
}

void ServerRegion::bind(lua_State* luaState){
    entities.bind(luaState);
	luabind::module(luaState)[
        luabind::class_<ServerRegion>("Region")
            .def_readwrite("x", &ServerRegion::x)
            .def_readwrite("y", &ServerRegion::y)
            .def_readwrite("width", &ServerRegion::width)
            .def_readwrite("height", &ServerRegion::height)
            .def_readwrite("hasScript", &ServerRegion::hasScript)
            .def_readwrite("updateable", &ServerRegion::updateable)
            .def_readwrite("hasExit", &ServerRegion::hasExit)
            .def_readwrite("hasEntry", &ServerRegion::hasEntry)
            .def_readonly("index", &ServerRegion::index)
            .def_readonly("entities", &ServerRegion::entities)
			.def_readonly("players", &ServerRegion::players)
			.def_readonly("regions", &ServerRegion::regions)
    ];
}

void ServerRegion::push(lua_State* luaState){
	luabind::object o = luabind::object(luaState, this);
    o.push(luaState);
}
